﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
namespace _3D
{
    
    class BaseWall
    {
        public List<GameObject3D> wall; 

        public BaseWall(Vector3 position, GraphicsDevice graphics, Camera camera, int ladoFrente, int altura, int largura, int size)
        {
            wall = new List<GameObject3D>();

            if (ladoFrente == 0)
            {
                for (int i = 0; i < largura; i++)
                {
                    for (int j = 0; j < altura; j++)
                    {
                        wall.Add(new Bloco(size, graphics, camera, new Vector3(position.X + 2*size* i, position.Y + 2*size * j, position.Z)));
                    }
                }
            }
            else
            {
                for (int i = 0; i < largura; i++)
                {
                    for (int j = 0; j < altura; j++)
                    {
                        wall.Add(new Bloco(size, graphics, camera, new Vector3(position.X, position.Y + 2*size * j, position.Z + 2*size * i)));
                    }
                }
            }

        }
        public void Update(Camera camera)
        {
            foreach(GameObject3D ob in wall)
            {
                ob.Update(camera);
            }
        }
        public void Draw(GraphicsDevice graphics)
        {
            foreach (GameObject3D ob in wall)
                ob.Draw(graphics);
        }
    }
}
